﻿using System.Web.Configuration;

namespace Gp.Examples.FullCalendar.Authentication
{
    public class LiveIdConfig
    {
        public static string LiveLoginUrl
        {
            get
            {
                var appMode = GetSetting("WLA_ApplicationMode");

                return string.Format("{0}://login.live.com/wlogin.srf?appid={1}&alg={2}&appctx=",
                         appMode,
                         ApplicationId,
                         ApplicationAlgorithm);
            }
        }

        public static string ApplicationId
        {
            get
            {
                return GetSetting("WLA_ApplicationId");
            }
        }

        public static string ApplicationAlgorithm
        {
            get
            {
                return GetSetting("WLA_ApplicationAlgorithm");
            }
        }

        public static string ApplicationKey
        {
            get
            {
                return GetSetting("WLA_ApplicationKey");
            }
        }

        public static string LockedUrl
        {
            get
            {
                return GetSetting("WLA_LockedUrl");
            }
        }

        private static string GetSetting(string name)
        {
            return WebConfigurationManager.AppSettings[name];
        }
    }
}